import request from '@/utils/request'

export function Get(id, args) {
  return request({
    url: `/erp/api/directly_upload_task/${id || ''}${args && ('?' + args) || ''}`,
    method: 'get'
  })
}

export function Post(data) {
  return request({
    url: '/erp/api/directly_upload_task',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function Put(id, data) {
  return request({
    url: `/erp/api/directly_upload_task/${id || ''}`,
    headers: { 'content-type': 'application/json' },
    method: 'put',
    data: JSON.stringify(data)
  })
}

export function Delete(id, data) {
  return request({
    url: `/erp/api/directly_upload_task/${id || ''}`,
    method: 'delete',
    data: data
  })
}

export function ReSend(id) {
  return request({
    url: `/erp/api/directly_upload_task_resend/${id || ''}`,
    method: 'get'
  })
}

export function ReSendMulti(data) {
  return request({
    url: `/erp/api/directly_upload_task_resend/`,
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function Statistics(id, args) {
  return request({
    url: `/erp/api/directly_upload_statistics/${id || ''}${args && ('?' + args) || ''}`,
    method: 'get'
  })
}

export function ChangeTaskState(data) {
  return request({
    url: '/erp/api/directly_upload_task_change_state/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function ChangeTaskEnable(data) {
  return request({
    url: '/erp/api/directly_upload_task_change_enable/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function AutoControlUpdate(data) {
  return request({
    url: '/erp/api/directly_upload_task_auto_control_update/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function GetServerInfo(data) {
  return request({
    url: '/erp/api/directly_upload_task_server_info/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}

export function ModifyWebsiteParam(data) {
  return request({
    url: '/erp/api/directly_upload_task_modify_website_param/',
    headers: { 'content-type': 'application/json' },
    method: 'post',
    data: data
  })
}
